import 'package:flutter/material.dart';

import '../appbar/custom_app_bar.dart';
import '../base/base_scaffold.dart';

///zhudaihao
///2024-1-29
///表格 UI
class EquipmentSpecificationPage extends StatelessWidget {
  EquipmentSpecificationPage({Key? key}) : super(key: key);

  List<SpecificationEquipment> list = [
    SpecificationEquipment(key: '净重', vale: '8.5'),
    SpecificationEquipment(key: '尺寸', vale: '176.*178.2'),
    SpecificationEquipment(key: '容量', vale: '25.6v'),
    SpecificationEquipment(key: '额定功率', vale: '800w'),
    SpecificationEquipment(
        key: '蓝牙', vale: '蓝牙版本：5.0 频率范围：2402-2480MHz 最大输出功率：4.27dBm'),
    SpecificationEquipment(key: '净重', vale: '8.5'),
    SpecificationEquipment(key: '尺寸', vale: '176.*178.2'),
    SpecificationEquipment(key: '容量', vale: '25.6v'),
    SpecificationEquipment(key: '额定功率', vale: '800w'),
    SpecificationEquipment(
        key: '蓝牙', vale: '蓝牙版本：5.0 频率范围：2402-2480MHz 最大输出功率：4.27dBm'),
    SpecificationEquipment(key: '净重', vale: '8.5'),
    SpecificationEquipment(key: '尺寸', vale: '176.*178.2'),
    SpecificationEquipment(key: '容量', vale: '25.6v'),
    SpecificationEquipment(key: '额定功率', vale: '800w'),
    SpecificationEquipment(
        key: '蓝牙', vale: '蓝牙版本：5.0 频率范围：2402-2480MHz 最大输出功率：4.27dBm'),
  ];

  @override
  Widget build(BuildContext context) {
    return BaseScaffold(
      appBar: const CustomAppBar(
        title: '表格',
      ),
      body: Container(
        color: const Color(0xFF0B0B0F),
        child: Container(
          height: double.infinity,
          width: double.infinity,
          decoration: const BoxDecoration(
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(24), topRight: Radius.circular(24)),
            color: Color(0xff1D1E26),
            border: Border(
              top: BorderSide(width: 1, color: Color(0xff30323E)),
            ),
          ),
          child: ListView.builder(
              itemCount: list.length,
              itemBuilder: (context, index) {
                return Column(
                  children: [
                    IntrinsicHeight(
                      child: Row(children: [
                        Container(
                          alignment: Alignment.center,
                          constraints: const BoxConstraints(minHeight: 40),
                          width: 144,
                          child: Text(
                            '${list[index].key}',
                            style: const TextStyle(
                                color: Color(0xffDFE0E7), fontSize: 14),
                          ),
                        ),
                        const VerticalDivider(
                          color: Color(0xff323440),
                          width: 1,
                        ),
                        Expanded(
                          child: Container(
                            padding: const EdgeInsets.only(
                                top: 13, bottom: 8, left: 8, right: 8),
                            alignment: Alignment.center,
                            constraints: const BoxConstraints(minHeight: 40),
                            child: Text(
                              '${list[index].vale}',
                              style: const TextStyle(
                                  color: Color(0xffDFE0E7), fontSize: 14),
                              textAlign: TextAlign.center,
                            ),
                          ),
                        ),
                      ]),
                    ),
                    const Divider(height: 1, color: Color(0xff323440))
                  ],
                );
              }),
        ),
      ),
    );
  }
}

class SpecificationEquipment {
  String? key;
  String? vale;

  SpecificationEquipment({this.key, this.vale});
}
